Skip to main content

Request a PR review

PR Review Cycle

  1. Creating a Pull Request

    When you've completed your changes in your branch, push them to the repository and create a new Pull Request (PR).

  2. Requesting a Review

    To initiate a review, request a reviewer on the GitHub PR page. This can be done by selecting a reviewer from the "Reviewers" section on the right-hand side of the PR page.

  3. Automated PR Review

    Once a reviewer is requested, on_pull_request workflow is triggered.

    Workflow overview

    The workflow consists of two jobs:

    • build_and_deploy_to_preview_site: This job checks out the repository, sets up Node.js, caches and installs dependencies, extracts the branch name, and builds the application.

    • pr_agent_job: This job uses the Codium-ai/pr-agent GitHub Action to automate the PR review process. This job depends on the successful completion of the first job. The PR agent uses OpenAI's Chat GPT model (gpt-3.5-turbo-16k) stored as a GitHub variable GPT_VERSION_FOR_PR_AGENT to analyze the changes in the PR and generate comments.

      • The PR agent analyzes the code changes and provides feedback based on the trained GPT model.
      • The GPT model (gpt-3.5-turbo-16k) is a powerful language model that can understand and generate human-like text.
      • The GitHub variable GPT_VERSION_FOR_PR_AGENT stores the GPT model, making it easily accessible for the PR agent job.
  4. Review Feedback

    Once the automated review is complete, you'll receive feedback in the form of comments, these include:

    • Main Theme of the PR: This provides with a clear understanding of the main objective or purpose of the PR.
    • Summary of the PR: A concise summary of the key points and changes made in the PR.
    • Type of PR: This indicates the type of PR, which can be helpful in categorizing and organizing your review process.
    • Presence of relevant tests: Checks if the PR includes relevant tests to ensure the quality and reliability of the code. Estimated Effort to review the PR: This provides an estimation of the effort required to review the PR.
    • Identification of security concerns: Security is a critical aspect of any code review. It helps in identifying and highlighting any potential security concerns that may exist in the PR.
    • Inline comments: The PR agent provides inline comments on specific lines of code, highlighting areas that need attention or improvement.
    • Suggestions for improvement: The PR agent provides suggestions for improvement based on the analysis of the code changes.
  5. Re triggering the Workflow

    • If you want to re trigger the on_pull_request workflow after making changes based on the review feedback, you need to remove the assignee and reassign them in the "Reviewers" section. This will trigger the workflow again and initiate a new review.

    • You can also initiate a review using the PR comments section. Simply comment /review to trigger the pr_agent workflow, which is specifically designed to react upon detecting certain keywords in the PR comments.

  6. Merging the PR

    Once the PR is approved, you need to squash and merge the PR. This can be done by selecting the "Squash and Merge" option from the "Merge" dropdown on the PR page.

Status: Accepted
Category: Protected
Authored By: Sohan on Apr 10, 2024